package thinkingJava.chapter17;

import java.util.ArrayList;

import thinkingJava.chapter15.Generator;

@SuppressWarnings("serial")
public class CollectionData<T> extends ArrayList<T> {
	public CollectionData(Generator<T> gen, int quantity) {
		for (int i = 0 ; i < quantity; i ++) {
			add(gen.next());
		}
	}
	public static <T> CollectionData<T> list(Generator<T> gen, int quantity) {
		return new CollectionData<T>(gen,quantity);
	}
}
